<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>层叠准则解析</title>
    <style>
        /* 层叠准则： 
        1.z-index谁大 谁靠上 
        2.后来居上
        */
        .box1{
            width: 200px;
            height: 200px;
            background-color: blueviolet;
            position: absolute;
            z-index:2
        }
        .box2{
            width: 300px;
            height: 300px;
            background-color: green;
            position: absolute;
            z-index:2;
        }
    </style>
</head>
<body>
    
    
    <div class="box2"></div>
    <div class="box1"></div>
   
</body>
</html>